home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / p_misc / netconf.arc / MAILER.TXT < prev    next >
Text File  |  1988-12-10  |  16KB  |  327 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                   The Design of a Mail System for the KA9Q Internet
  11.                                    Protocol Package
  12.  
  13.  
  14.                                  Bdale Garbee, N3EUA
  15.                             Gerard van der Grinten, PA0/GRI
  16.  
  17.  
  18.  
  19.                                        _A_B_S_T_R_A_C_T
  20.  
  21.                      The current implementation of the mail  manipula-
  22.                 tion  system  that  has been built by N3EUA and PA0/GRI
  23.                 for the KA9Q Internet Protocol  Package  is  described
  24.                 briefly.   A  proposal for the next generation of net-
  25.                 work mail handling for the KA9Q  Internet  environment
  26.                 is  described.   An important change in the way we can
  27.                 and should think about electronic mail in the  amateur
  28.                 packet radio world is discussed.
  29.  
  30.  
  31.  
  32.            _B_a_c_k_g_r_o_u_n_d:
  33.  
  34.            Since the conception of ``Amateur Packet Radio'', quite a bit of
  35.            evolution has occurred.  Many lessons have been learned the hard
  36.            way, and many are yet to be learned.  However, one  point  which
  37.            has  become  increasingly obvious to those of us involved in the
  38.            development of packet radio software, is that a much  more  con-
  39.            sistent  and  powerful  way of dealing with electronic mail mes-
  40.            sages is
  41.  
  42.            In the beginning, there was raw data transfer from  point  A  to
  43.            point B without any protocol, and it was good.  Then came a pro-
  44.            tocol called AX.25, which allowed for error-free  point-to-point
  45.            virtual  circuit  links,  and  it was better.  Most recently has
  46.            come an implementation of the DARPA TCP/IP protocol family,  and
  47.            it  is  the  best  so  far.   The fact that this protocol family
  48.            includes a defacto real-world mail-handling protocol, SMTP,  has
  49.            caused  some  interesting changes in the way we think about mail
  50.            in packet radio.
  51.  
  52.            The current state-of-the-practice in amateur digital  mail  han-
  53.            dling is for one user, or ham, to ``log into'' a local PBBS sys-
  54.            tem, by establishing a virtual circuit to the PBBS's user inter-
  55.            face.   He  can then enter, read, or delete a given message, and
  56.            then ``log off''.  Whenever users are not connected to the PBBS,
  57.            it is available to attempt ``forwarding'' of the mail, a process
  58.            in which ``packets'' consisting of entire  messages  are  routed
  59.            from  one  PBBS to another.  Once the message has arrived at the
  60.            destination system, the end user or ham  can  read  the  message
  61.  
  62.  
  63.                                    December 6, 1988
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.            using  the same ``connect to the PBBS'' sequence that the sender
  73.            used.
  74.  
  75.            There are some fundamental design problems  with  this  process.
  76.            It works, and has solved the first part our mail-handling needs.
  77.            But it requires that both the sending and receiving participants
  78.            spend  a  non-trivial  amount  of  their time interacting with a
  79.            remote user-interface, which  implicitly  includes  waiting  for
  80.            channel throughput on the AX.25 circuit.  In addition, there are
  81.            very few services available to the user, such as message archiv-
  82.            ing  or  printing, message forwarding, editing of messages, etc.
  83.            It is also the case that some mechanism (usually  beacons)  must
  84.            be  provided to allow the receiving mail user to know that there
  85.            is a message waiting for him on his local PBBS.
  86.  
  87.            It is interesting to note that these limitations are  well-known
  88.            and  understood  in  the packet community.  An interesting trend
  89.            has been the creation of programs to allow machines such as  the
  90.            Tandy  100  and C64 to serve as ``mini-PBBS'' systems, or ``per-
  91.            sonal mailboxes''.  Moving as much of the  mail  user  interface
  92.            from  a  remote  system to the user's local computer as possible
  93.            provides several benefits.  The user need no longer  suffer  the
  94.            delays   associated  with  packet  flow  on  the  channel  while
  95.            interacting with the mail system, and  it  becomes  possible  to
  96.            provide  features  such  as  message  filing, printing, and more
  97.            extensive reply and forward capabilities.  While  this  may  not
  98.            have  been possible in the early days of packet radio due to the
  99.            use of dumb terminals as  packet  stations,  almost  all  packet
  100.            radio stations today include a computer as the end terminal.
  101.  
  102.            While a transfer of the mail user interface from a PBBS  to  the
  103.            user's  local  machine is in theory possible with any underlying
  104.            network protocol family, the recent development by KA9Q and oth-
  105.            ers  of  a  complete implementation of the DARPA TCP/IP protocol
  106.            family, including the defacto-standard  mail  transfer  protocol
  107.            SMTP, has hastened the need for such a transfer.  Implementing a
  108.            rational mail user interface and underlying servers for the KA9Q
  109.            Internet  Package  has  been  a  most challenging task, with the
  110.            resulting system's design principles and  implementation  trade-
  111.            offs occupying the remainder of this paper.
  112.  
  113.            _T_h_e _C_u_r_r_e_n_t _I_m_p_l_e_m_e_n_t_a_t_i_o_n:
  114.  
  115.            The current mail system in the KA9Q Internet package consists of
  116.            an  SMTP  server  and  SMTP  client that are integrated into the
  117.            NET.EXE package, and a separate mail user-interface.   The  mail
  118.            user  interface,  while  currently  sporting  a  very terse user
  119.            interface, provides facilities for creation and reading of  mes-
  120.            sages, and some crude message filing capabilities.
  121.  
  122.            When a user wishes to send a mail message, he runs the mail user
  123.            interface  program  _B_M, and enters the destination address, sub-
  124.            ject, and text of his message.   The  message  is  queued  in  a
  125.            directory  on  his  machine  for later transmission.  At regular
  126.  
  127.  
  128.                                    December 6, 1988
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.            intervals, the SMTP client in NET.EXE scans the queue  directory
  138.            and  attempts  to  process waiting outbound mail messages.  Each
  139.            message is delivered by the client directly to the server at the
  140.            destination station.
  141.  
  142.            When an incoming message arrives at the local SMTP server, it is
  143.            appended  to  a  mailbox file, the name of which is based on the
  144.            username given in the destination  address.   Multiple  real  or
  145.            pseudo-users  (for  mailing  lists) are therefore supported on a
  146.            given machine.  At his leisure, the user can  run  the  _B_M  user
  147.            interface  to  read  and  manipulate the messages in his mailbox
  148.            file(s), and/or can manipulate them directly as disk text files.
  149.  
  150.            The biggest change from existing PBBS mail handling is that  the
  151.            user  never  has  to  wait for a packet to be transferred on the
  152.            channel.  All on-air activity is handled automatically ``in  the
  153.            background''.
  154.  
  155.            _E_n_v_i_r_o_n_m_e_n_t:
  156.  
  157.            As may be obvious, the design concepts and implementation  ideas
  158.            presented  here are applicable regardless of the particular com-
  159.            puter facilities in use, and/or the specific low-level transport
  160.            protocol and mechanism available.  However, for the sake of com-
  161.            parison and reference, we will describe briefly the hardware and
  162.            software  environment  under which our mailer implementation has
  163.            been developed.
  164.  
  165.            The KA9Q Internet Package has been developed on the IBM PC,  and
  166.            close  compatibles.  It uses the Intel Small Memory Model, which
  167.            allows 64k of code space and 64k of data space on the 8088  pro-
  168.            cessor.  In an effort to avoid the necessity of going to a large
  169.            memory model with the attendant segment maintenance overhead  on
  170.            the 8088, and as an aid to generality and portability, functions
  171.            such as the mail user interface are being developed as  separate
  172.            applications,  designed to run concurrently with the KA9Q Inter-
  173.            net Package using a PC multitasking package such  as  Doubledos.
  174.            In the future, the ideas and algorithms presented here will most
  175.            likely be implemented under Minix/Unix as well.
  176.  
  177.            Hardware requirements are essentially the same as for  the  KA9Q
  178.            package itself, except that mail handling can frequently consume
  179.            considerably more disk space that is required for  the  protocol
  180.            package to run, meaning that a large forwarding site will need a
  181.            hard disk.  A simple single or dual user PC should  be  able  to
  182.            get by on one 360k floppy drive.
  183.  
  184.            All of the mailer software, as with the rest of the  KA9Q  pack-
  185.            age,  has been written in C using the Aztec MS-Dos compiler.  It
  186.            is therefore extremely portable, with the exception of  a  small
  187.            module  of  PC-specific  file-system  oriented  functions, which
  188.            should be easily translatable to other operating environments.
  189.  
  190.  
  191.  
  192.                                    December 6, 1988
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.            _T_o_p-_L_e_v_e_l _D_e_s_i_g_n - _O_u_r _G_o_a_l_s:
  202.  
  203.            The next step in the development of our mail  system  is  parti-
  204.            tioning  of  the mail handling tasks.  We choose to separate our
  205.            operations into four distinct categories: user interface,  rout-
  206.            ing, reception, and delivery.
  207.  
  208.            The user interface level is fairly obvious.  This is the hunk of
  209.            code that the user actually sees, and which allows him to enter,
  210.            read, print, file, delete, forward, etc., all of the messages he
  211.            must  deal  with.  There can and should be an ability to support
  212.            multiple user interfaces, to deal with varied and changing  user
  213.            needs, hardware availability, etc.
  214.  
  215.            In the middle, a ``routing agent'' receives requests  from  user
  216.            interfaces,  and  determines  the appropriate target address and
  217.            delivery agent for each message.  It is the only place in  which
  218.            knowledge  about  the  mapping  between  mail addresses and mail
  219.            delivery techniques should exist.
  220.  
  221.            At the other end of the scale  are  the  (potentially  multiple)
  222.            mail  delivery agents.  These are the functional blocks designed
  223.            to take a message in a reasonable format (for them),  and  actu-
  224.            ally do the work of delivering it. In the SMTP world, this might
  225.            entail opening a TCP connection to  the  destination  host,  and
  226.            engaging  in  the  SMTP  protocol to deliver the message. In the
  227.            UUCP world,  this  might  include  looking  up  and  dialing  an
  228.            appropriate  telephone  number, performing the login dialog, and
  229.            then engaging in the required uucp protocols (similar to the way
  230.            uucico  works under Unix).  In the Fido world, this might simply
  231.            be a matter of reformating the message file into a Fido-  compa-
  232.            tible  message,  and  moving it to an appropriate directory on a
  233.            PC's hard disk.
  234.  
  235.            The final class of entity is the  mail  reception  agent.   Each
  236.            server  receives  inbound  messages from one of potentially many
  237.            mail services and puts them in the routing agent's queue, in the
  238.            same  manner that a user interface queues a new message for pro-
  239.            cessing.
  240.  
  241.            The flow of information therefore includes an influx of messages
  242.            to  be  handled, both locally created by the user and his inter-
  243.            face, and remotely created and received by a server.  All  pend-
  244.            ing  messages pass into a queue and are processed by the router.
  245.            The router places each message, potentially with some additional
  246.            delivery  information, into the queue associated with a particu-
  247.            lar mail delivery agent.  Each delivery agent watches its  queue
  248.            for messages to process, and attempts to deliver them.
  249.  
  250.            _T_h_e _C_o_r_e _o_f _t_h_e _I_m_p_l_e_m_e_n_t_a_t_i_o_n:
  251.  
  252.            Some simple observation of the mail management  system  that  we
  253.            have  thus far described should reveal the fact that a consider-
  254.            able amount of work  will  be  done  enqueueing  and  dequeueing
  255.  
  256.  
  257.                                    December 6, 1988
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.            messages  in  a set of queues, one for the routing agent and one
  267.            for each delivery agent.  To allow for  a  consistent  means  of
  268.            handling  queue'ed  messages, a combination of file system usage
  269.            and custom databasing routines has been laid out.
  270.  
  271.            In the most general case, a queue  entry  will  consist  of  two
  272.            files,  one  for  the text of the message (most likely in RFC822
  273.            format), and one for the ``work'' information required by a par-
  274.            ticular  delivery  agent, or the router.  A very reasonable idea
  275.            is to force each of these files  to  have  a  completely  unique
  276.            name.   Thus, the primary task of the database is to manage file
  277.            naming, and connection of a given text file with it's associated
  278.            work  files.   Exact  details  of  the database are the topic of
  279.            current design effort as of this writing.
  280.  
  281.            The routing agent is an extremely important part of this design.
  282.            It  must ``read'' each message and make some determination about
  283.            which delivery agent  should  be  used,  and  what  address  the
  284.            delivery  agent  should  try to deliver to.  In some situations,
  285.            such as forwarding uucp mail, which is frequently source-routed,
  286.            there  is  information  external  to  the message body that will
  287.            allow the router to ``cheat''.  In the majority of  cases,  how-
  288.            ever,  the  router will have to deduce the appropriate agent and
  289.            address by reading the To: address field  in  the  RFC822-format
  290.            message body, and comparing it to patterns present in a table of
  291.            heuristics.
  292.  
  293.            _C_o_n_c_l_u_s_i_o_n:
  294.  
  295.            The intent of this paper is to document the current  status  and
  296.            future plans of those working on the mail user interface associ-
  297.            ated with the KA9Q Internet package.  Because a  great  deal  of
  298.            the  detail  about how the system is and will be put together is
  299.            still in a state of flux, it would seem inappropriate to discuss
  300.            that  detail  here.   Those interested in following the progress
  301.            of, and/or assisting in the work remaining in this project,  are
  302.            directed to contact one or both of the authors.
  303.  
  304.            _R_e_f_e_r_e_n_c_e_s:
  305.  
  306.            1.   RFC821, Simple Mail Transfer Protocol.
  307.  
  308.            2.   RFC822, Standard for the Format of Internet Text Messages.
  309.  
  310.            3.   Allman, Eric, ``SENDMAIL - An Internetwork  Mail  Router'',
  311.                 supplied with the 4bsd Unix manual set.
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.                                    December 6, 1988
  322.  
  323.  
  324. 
  325.